<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge，chrome=1">

    <title>教师修改课程信息</title>

    <link rel="stylesheet" href="/static/css-lib/bootstrap.min.css" />
    <link rel="stylesheet" href="/static/css-cus/flatpickr.css" />

    <style>
        .item-border {
            border-left: none;
            border-right: none;
        }
    </style>
</head>
<body>

    <!-- 头部区域 -->
    <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
                <a class="navbar-brand" href="#">课时信息修改</a>
            </div>
            <div style="position: absolute;top: 10px;right: 130px;">
                <button id="delete-btn" data-id="<c:out value="${ClassInfo.classId}" />" type="button" class="btn btn-danger">删除</button>
            </div>
            <div style="position: absolute;top: 10px;right: 30px;">
                <button id="alter-btn" data-id="<c:out value="${ClassInfo.classId}" />" type="button" class="btn btn-primary">修改</button>
            </div>
        </div>
    </nav>

    <!-- 内容区域 -->
    <div class="container-fluid" style="margin-top: 55px;">
        <div class="row list-group">
            <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 list-group-item item-border">
                <div class="input-group">
                    <span class="input-group-addon">学生</span>
                    <c:choose>
                        <c:when test="${ClassInfo.studentRealName eq ''}">
                            <input id="student" type="text" class="form-control" value="<c:out value="${ClassInfo.studentName}" /> " disabled />
                        </c:when>
                        <c:otherwise>
                            <input id="student" type="text" class="form-control" value="<c:out value="${ClassInfo.studentRealName}" /> " disabled />
                        </c:otherwise>
                    </c:choose>
                </div>
            </div>
            <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 list-group-item item-border">
                <div class="input-group">
                    <span class="input-group-addon">课程</span>
                    <input id="course" type="text" class="form-control" value="<c:out value="${ClassInfo.subjectName}" />" disabled />
                </div>
            </div>
        </div>
        <div class="row list-group">
            <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 list-group-item item-border">
                <div class="input-group">
                    <span class="input-group-addon">课时</span>
                    <input id="class-name" type="text" class="form-control" value="<c:out value="${ClassInfo.className}" />" placeholder="1~40个字符" maxlength="40" minlength="1" />
                </div>
            </div>
            <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 list-group-item item-border">
                <div class="input-group">
                    <span class="input-group-addon">上课时间</span>
                    <input id="class-time" type="datetime-local" class="form-control" value="<fmt:formatDate value="${ClassInfo.classTime}" pattern="yyyy-MM-dd\'T\'HH:mm" />" />
                </div>
            </div>
        </div>
        <div class="row list-group">
            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 list-group-item">
                <div class="input-group" style="width: 100%;">
                    <label for="class-comment">备注</label>
                    <br/>
                    <textarea id="class-comment" class="form-control" style="width: 50%;" maxlength="40" placeholder="限制40个字符"><c:out value="${ClassInfo.classComment}" escapeXml="false" /></textarea>
                </div>
            </div>
        </div>
    </div>

    <!-- 错误提示框 -->
    <div id="error-box" class="modal fade" tabindex="-1" role="dialog" data-backdrop="false">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                    <h4 class="modal-title">错误</h4>
                </div>
                <div id="error-content" class="modal-body"></div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                </div>
            </div>
        </div>
    </div>

    <!-- 信息警告框 -->
    <div id="alert-box" class="modal fade" tabindex="-1" role="dialog" data-backdrop="false">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                    <h4 class="modal-title">警告</h4>
                </div>
                <div class="modal-body">
                    您确定要删除这条课时信息吗？删除后将不可恢复
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">我再想想</button>
                    <button id="confirm-delete" type="button" class="btn btn-danger">确定删除</button>
                </div>
            </div>
        </div>
    </div>

    <script src="/static/js-lib/jquery-3.4.1.min.js"></script>
    <script src="/static/js-cus/teacher/flatpickr.js"></script>
    <script src="/static/js-cus/teacher/Frame-AlterClassInfo.js"></script>
</body>
</html>